﻿function ViewProjectViewModel(model) {
    var selfModel = this;
    var isMain = true;

    selfModel.Controller = "ViewProject";
    selfModel.StartPage = selfModel.Controller + "View";

    ko.mapping.fromJS(model, {}, selfModel);

    /* Poner acá codigo para GetHtml */

    Main.State.Hashes.push("Investment");
    Main.State.Hashes.push("InvestmentCreate");

    selfModel.InvestmentViewModel.Entity.ProjectId = selfModel.Entity.Id;
    console.log(selfModel.InvestmentViewModel);
    selfModel.InvestmentViewModel = new InvestmentViewModel(selfModel.InvestmentViewModel);
    console.log(selfModel.InvestmentViewModel.Entity.ProjectId());

    selfModel.CommentViewModel.Entity.ProjectId = selfModel.Entity.Id;
    selfModel.CommentViewModel = new CommentViewModel(selfModel.CommentViewModel);

    //selfModel.Init(isMain);

    Main.Page.Init(selfModel.StartPage, selfModel.Controller);
}